//2009/08/18 23:43:10
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class AccountBalance
{
public:
    int processTransactions(int startingBalance, vector <string> transactions)
    {
		int ret = startingBalance;
		for(int i=0; i<transactions.size(); i++)
		{
			char c; int num;
			stringstream s(transactions[i]);
			s >> c >> num;
			if(c == 'C') ret += num;
			else ret -= num;
		}
		return ret;
    }
};
